﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Enterprise.Infrastructure;
using Enterprise.Model.BusiTravel;
using Enterprise.Service.BusiTravel;
using Enterprise.Model.WorkFlow;
using Enterprise.Service.WorkFlow;
namespace Enterprise.UI.Web.Modules.BusiTravel
{
    public partial class Detail : System.Web.UI.Page
    {
        string BID = (string)Utility.sink("Id", Utility.MethodType.Get, 0, 0, Utility.DataType.Str);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                OnStart();
            }
        }

        private void OnStart()
        {
            BusiTravelService bService = new BusiTravelService();
            var query = bService.BusiTravelDisp(BID);
            if (query != null)
            {
                lb_Dept.Text = Enterprise.Service.Department.DepartmentService.GetDepartMentName(query.DEPTID);
                lb_User.Text = Enterprise.Service.User.UserService.GetUserName(query.USERID);
                lb_Subject.Text = query.BSUBJECT;
                lb_Disniation.Text = query.BDESTINATION;
                lb_Line.Text = query.BLINE;
                lb_STme.Text = query.BSTARTIME.ToShortDateString();
                lb_ETime.Text = query.BENDTIME.ToShortDateString();
                lb_Time.Text = query.BCREATETIME.ToString();
                WorkFlowProcessService wfpService = new WorkFlowProcessService();
                GridView1.DataSource = wfpService.WorkFlowProcessListByWorkFlow(query.BID);
                GridView1.DataBind();
            }
        }

    }
}